import requests
import time

headers = {
    'Host': 'mini.qituke.com',
    'xweb_xhr': '1',
    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF XWEB/8447',
    'content-type': 'application/x-www-form-urlencoded',
    'accept': '*/*',
    'sec-fetch-site': 'cross-site',
    'sec-fetch-mode': 'cors',
    'sec-fetch-dest': 'empty',
    'referer': 'https://servicewechat.com/wxaad717fd13c604b9/10/page-frame.html',
    'accept-language': 'zh-CN,zh;q=0.9',
}


userlist = (
    {'user_id': '584321', 'token': '966a0006f24c8cce776390b657cdb807'},
    {'user_id': '590121', 'token': 'a0b29a7aedda4410b67d531702a11ad4'},
    {'user_id': '585173', 'token': 'b0e806e3470c32fde92b97e5a7507cf8'},
)

# 幻想岛互助：  1074
# 幻想岛PK：    1076
# 做任务互助：  1072
# 攒能量互助：  1073
# 农场互助：    1062


active_id=['1074','1076','1072','1073','1062']

while True:
    for user in userlist:
        for id in active_id:
            data = {
            'wxapp_id': '10001',
            'user_id': user['user_id'],
            'token': user['token'],
            'version': '2.2.0',
            'action': 'refresh',
            'id': id,
            }
            response = requests.post('https://mini.qituke.com/api/huzhu/ajax', headers=headers, data=data,verify=False)
            print(response.json())
            time.sleep(5)
        time.sleep(5)
    time.sleep(60*30)